#include "../userprog/syscall.h"
void main(){

char* execName;
int nameLen;

int NUM_CONCESSION_CLERKS;
int latestIndexLock;
int latestIndexCondition;
int latestIndex;

latestIndexLock = CreateLock("latestIndexLock",15);
latestIndex = CreateMV(1, "latestIndex", 11);
latestIndexCondition = CreateCondition("latestIndexCondition",20);
NUM_CONCESSION_CLERKS = CreateMV(1, "NUM_CONCESSION_CLERKS", 21);

for(SetMV(latestIndex,0,0); GetMV(latestIndex,0) < GetMV(NUM_CONCESSION_CLERKS,0); SetMV(latestIndex,0,GetMV(latestIndex,0) + 1))
{
	AcquireLock(latestIndexLock);
	execName = "../test/concessionclerk";
	nameLen = 23;
	Exec(execName, nameLen);
	
	WaitCondition(latestIndexCondition, latestIndexLock);
	ReleaseLock(latestIndexLock);

}
}